<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('修改实习期变动人员')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-internship-edit" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${editInternshipEmp.id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label ">工号：</label>
            <div class="col-sm-8">
                <input class="form-control" id="badge" type="text" th:value="${editInternshipEmp.badge}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" id="name" type="text" th:value="${editInternshipEmp.name}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">公司名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="compName" type="text" th:value="${editInternshipEmp.compName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">部门名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="depName" type="text" th:value="${editInternshipEmp.depName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">岗位名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="jobName" type="text" th:value="${editInternshipEmp.jobName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">入职时间：</label>
            <div class="col-sm-8">
                <input class="form-control" id="JoinDate" type="text" th:value="${editInternshipEmp.joindate}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">新实习期(月)：</label>
            <div class="col-sm-8">
                <input class="form-control"oninput = "value=value.replace(/[^\d]/g,'')" id="NewPracterm" name="NewPracterm" type="text" th:value="${editInternshipEmp.NewPracterm}"
                      required/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">新实习结束日期：</label>
            <div class="col-sm-8">
                <input class="form-control laydate-demo-1" id="NewPracEndDate" name="NewPracEndDate" type="text" th:value="${editInternshipEmp.NewPracEndDate}"
                       required/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">生效日期：</label>
            <div class="col-sm-8">
                <input class="form-control laydate-demo-2" id="effectdate" name="effectdate" type="text" th:value="${editInternshipEmp.effectdate}"
                       required/>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "changeManage/InternshipChange";


    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });

    });


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-internship-edit").serializeArray();
            var id = $("#id").val();
            var NewPracterm = $("#NewPracterm").val();
            var NewPracEndDate = $("#NewPracEndDate").val();
            var effectdate = $("#effectdate").val();
            data.push({"name": "id", "value": id});
            data.push({"name": "NewPracterm", "value": NewPracterm});
            data.push({"name": "NewPracEndDate", "value": NewPracEndDate});
            data.push({"name": "effectdate", "value": effectdate});
            $.operate.save(prefix + "/edit", data);
        }
    }

</script>


</body>
</html>